<template>
  <div>
    <Chart :cdata="cdata"/>
  </div>
</template>

<script>
import Chart from './chart.vue'
import {getYnData} from "@/axios/api";

export default {
  data() {
    return {
      cdata: {
        // X轴坐标
        category: [
          "05-7",
          "05-8",
          "05-9",
          "05-10",
          "05-11"
        ],
        // 新增本土
        lineData: [
          0,
          0,
          0,
          0,
          0,
        ],
        // 新增境外
        barData: [
          0,
          0,
          0,
          0,
          4
        ]
      }
    };
  },
  components: {
    Chart,
  },
  mounted() {
    this.getYnData()
  },
  methods: {
    async getYnData() {
      let data = await getYnData().then(res => res.data)
      this.cdata.category = data[2]
      this.cdata.lineData = data[0]
      this.cdata.barData = data[1]
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
